<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/11/7
  Time: 16:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/mb/jsp/common.jsp" %>
<%@ page import="com.limao.servlet.WebFunction" %>
<%@ page import="com.limao.DBDataClass.CrowdUserAuthClass" %>

<%
    String userid=CacheClass.isLogin(request,response);
    if (CacheClass.getIntValue(userid) == 0) {
        out.println("<script language='JavaScript'>alert('您还没有登陆！');location.href=document.referrer;</script>"); //后退并刷新
        return;
    }
    CrowdUserAuthClass user = WebFunction.getUserInfo(request, response);
    if (user == null) {
        out.println("<script language='JavaScript'>alert('用户不存在，或被平台禁用，请联系客服！');window.history.back(-1);</script>");
        return;
    }
%>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新手学堂</title>

    <script src="mb/js/jquery.qrcode.js"></script>
    <script src="mb/js/utf.js"></script>

</head>
<body ontouchstart="">
<div class="detailTop pf w100 of">
    <div class="w100 of tc cf f18">
        <span class="pa" style="left: 2px;" onclick="javascript:history.back();"><img src="mb/images/top_back_white.png" style="margin-top: 4px;height: 40px;width: 40px;"/></span>
		  新手学堂
    </div>
</div>

<div class="container db jz mgt45" style="overflow: visible;">
  <section class="personalAllInfo w100 pr withdrawBack" style="height:192px">
        <div class="pa w100" style="top: 46px;left:0;width:100%;color:#5059f6;">
        	<div class="w95 jz of bcf br4 pdt10 pdb10">
        		<div id="listContainer" class="w95 jz mgt10 mgb10">
	        		
        		</div>
        		
        	</div>
       </div>
    </section>
</div>


<script>

  $(document).ready(function(){
	
		getData();
	  
	});


//加载新数据
    function getData() {
        $.ajax({
            url: "LoginServlet",
            data: JSON.stringify({m: 100}),
            type: 'post',
            dataType: 'json',
            contentType: "application/json;charset=utf-8",
            beforeSend: function () {
                showProgressDg();
            },
            success: function (data) {
               if (data.state == 1) {
                  showData(data.list);
                } else {
                    // 其他错误弹出提示
                    showToast(data.info);
                }
            },
            error: function (data) {
                showToast(data.info);
            },
            complete: function () {
                closeProgressDg();
            }
        });
    }
    
    function showData(list)
    {
    	var htmlStr="";
    	$.each(list, function(index, obj) 
    	{
    		var klassStr = "b-b";
    		if(index == list.length-1){
    			klassStr ="";
    		}
    		htmlStr +=
	    		   	'<a href="mb/jsp/beginnerSchoolDetail.jsp?studyid='+obj.studyid+'" class="db flexBox pdt10 pdb10 '+klassStr+'">'+
	        			'<div class="df" style="flex-grow: 2;">'+
		        			 '<p class="f20">&bull;</p>'+
		        			 '<p class="f15 mgl10 lh15">'+obj.studytitle+'</p>'+
	        			'</div>'+
	        			 '<img src="mb/images/img10.png" alt="" class="db wauto rotate-90" style="height:9px;">'+            	
	        		'</a>'; 
    		
    	});
    	
    	 $("#listContainer").html(htmlStr);
    } 

</script>

</body>
</html>
